home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: delta / whiteline CD Series - delta.iso / tex / style / misc / cyracc.def < prev    next >
Text File  |  1995-11-25  |  9KB  |  266 lines

  1. %  CYRACC.DEF                                           February 1990
  2. %
  3. %  This file contains definitions of accents and special characters
  4. %  required for use of cyrillic fonts arranged according to the AMS scheme.
  5. %
  6. %  American Mathematical Society, Technical Support Group, P. O. Box 6248,
  7. %        Providence, RI 02940
  8. %  800-321-4AMS or 401-455-4080;  Internet: Tech-Support@Math.AMS.com
  9. %
  10. %  Copyright (C) 1990, American Mathematical Society.
  11. %  All rights reserved.  Copying of this file is authorized only if either:
  12. %       (1) you make absolutely no changes to your copy including name; OR
  13. %       (2) if you do make changes, you first rename it to some other name.
  14. %
  15. %
  16. %  The \font specification(s) should be made elsewhere, and should include
  17. %       \newfam\cyrfam
  18. %       \font\...cyr=wncyr...   (e.g. \font\tencyr=wncyr10 )
  19. %
  20. %  An appropriate definition for cyrillic, usable in math and text, is
  21. %       \def\cyr{\fam\cyrfam\...cyr\cyracc}
  22. %
  23. %  More extensive instructions for using cyrillic fonts are included in
  24. %  the AMSFonts 2.0 User's Guide.
  25. %
  26. %  See end of file (after \endinput) for additional notes.
  27. %
  28. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  29.  
  30.  
  31. \chardef\tempcat=\the\catcode`\@
  32. \catcode`\@=11
  33.  
  34. %  The first set of definitions is what will be in effect outside of cyrillic,
  35. %  i.e., in transliterated text.
  36.  
  37. %  Definition of \cydot is not ideal; real dot should be in an accent font.
  38. \def\cydot{{\mathsurround=0pt$\cdot$}}
  39.  
  40. %  \ubar is the definition of \b from PLAIN; it may not work in math mode.
  41. \def\ubar#1{\oalign{#1\crcr\hidewidth
  42.     \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}}
  43.  
  44. %  Soft and hard signs are represented in transliteration by prime and
  45. %  double prime respectively.
  46. \def\cprime{\/{\mathsurround=0pt$'$}}
  47. \def\Cprime{{\mathsurround=0pt$'$}}
  48. \def\cdprime{\/{\mathsurround=0pt$''$}}
  49. \def\Cdprime{{\mathsurround=0pt$\ubar{\hbox{$''$}}$}}
  50.  
  51. \def\dbar{dj}           % make real barred d when accent font available
  52. \def\Dbar{Dj}           %  ""
  53.  
  54. %  It would be nice to make these control sequences unnecessary; that will
  55. %  probably require d to become active.
  56. \def\dz{dz}
  57. \def\Dz{Dz}
  58. \def\dzh{dzh\cydot }
  59. \def\Dzh{Dzh\cydot }
  60.  
  61.  
  62. %  Stress marks are sometimes used in cyrillic text, mainly for pedagogic
  63. %  reasons.  These definitions support stress marks within {\cyr ...};
  64. %  in transliteration, they are suppressed.  Stress is indicated in
  65. %  input by \! preceding a letter on which a stress mark is to appear;
  66. %  an acute accent will appear in the output.  Since \! is also a plain
  67. %  command, for negative thin space in math mode, test for math mode and
  68. %  include the plain definition as appropriate.
  69.  
  70. \def\@gobble#1{}
  71. \def\@testgrave{\`}
  72. \def\@stressit{\futurelet\chartest\@stresschar }
  73.  
  74. \def\@stresschar#1{%
  75.   \ifx #1y\def\result{\futurelet\chartest\@yligature}%
  76.   \else \ifx #1Y\def\result{\futurelet\chartest\@Yligature}%
  77.   \else \ifx\chartest\@testgrave \def\result{\accent"26 }%
  78.   \else \def\result{\accent"26 #1}%
  79.   \fi \fi \fi
  80.   \result }
  81.  
  82. \def\@yligature{%
  83.   \ifx a\chartest \def\result{\accent"26 \char"1F \@gobble}%
  84.   \else \ifx u\chartest \def\result{\accent"26 \char"18 \@gobble}%
  85.   \else \def\result{\accent"26 y}%
  86.   \fi \fi
  87.   \result }
  88.  
  89. \def\@Yligature{%
  90.   \ifx a\chartest \def\result{\accent"26 \char"17 \@gobble}%
  91.   \else \ifx A\chartest \def\result{\accent"26 \char"17 \@gobble}%
  92.   \else \ifx u\chartest \def\result{\accent"26 \char"10 \@gobble}%
  93.   \else \ifx U\chartest \def\result{\accent"26 \char"10 \@gobble}%
  94.   \else \def\result{\accent"26 Y}%
  95.   \fi \fi \fi \fi
  96.   \result }
  97.  
  98. \def\!{\ifmmode \mskip-\thinmuskip \fi}
  99.  
  100.  
  101. %  These are the definitions that will produce cyrillic letters within
  102. %  {\cyr ...} for letters represented in input by control sequences and
  103. %  accented latin letters.
  104.  
  105. \def\cyracc{%
  106.   \def\cydot{{\kern0pt}}%
  107.   \def\cprime{\char"7E }\def\Cprime{\char"5E }%
  108.   \def\cdprime{\char"7F }\def\Cdprime{\char"5F }%
  109.   \def\dbar{dj}\def\Dbar{Dj}%
  110.   \def\dz{\char"1E }\def\Dz{\char"16 }%
  111.   \def\dzh{\char"0A }\def\Dzh{\char"02 }%
  112.   \def\'##1{\if c##1\char"0F %
  113.     \else \if C##1\char"07 %
  114.     \else \accent"26 ##1\fi \fi }%
  115.   \def\`##1{\if e##1\char"0B %
  116.     \else \if E##1\char"03 %
  117.     \else \errmessage{accent \string\` not defined in cyrillic}%
  118.         ##1\fi \fi }%
  119.   \def\=##1{\if e##1\char"0D %
  120.     \else \if E##1\char"05 %
  121.     \else \if \i##1\char"0C %
  122.     \else \if I##1\char"04 %
  123.     \else \errmessage{accent \string\= not defined in cyrillic}%
  124.         ##1\fi \fi \fi \fi }%
  125.   \def\u##1{\if \i##1\accent"24 i%
  126.     \else \accent"24 ##1\fi }%
  127.   \def\"##1{\if \i##1\accent"20 \char"3D %
  128.     \else \if I##1\accent"20 \char"04 %
  129.     \else \accent"20 ##1\fi \fi }%
  130.   \def\!{\ifmmode \def\result{\mskip-\thinmuskip}%
  131.     \else \def\result{\@stressit}\fi \result}}
  132.  
  133.  
  134. %       If cyrillic strings are to be included in \mark's, the accents need
  135. %       to be kept in unexpanded form until the \mark's are interpreted.
  136. %       See note on \mark below for details.
  137.  
  138. \def\keep@cyracc{\let\cyr=\relax \let\i=\relax
  139.         \let\ubar=\relax \let\cydot=\relax
  140.         \let\cprime=\relax \let\Cprime=\relax
  141.         \let\cdprime=\relax \let\Cdprime=\relax
  142.         \let\dbar=\relax \let\Dbar=\relax
  143.         \let\dz=\relax \let\Dz=\relax
  144.         \let\dzh=\relax \let\Dzh=\relax
  145.         \let\'=\relax \let\`=\relax \let\==\relax
  146.         \let\u=\relax \let\"=\relax \let\!=\relax }
  147.  
  148.  
  149. \catcode`\@=\tempcat
  150. \endinput
  151.  
  152. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  153. %
  154. %                       *****   CYRACC.DEF      *****
  155. %
  156. %  Access to the cyrillic is through the MR 1980 transliteration scheme,
  157. %  using TeX/Metafont ligature capability.  (An alternate set of ligatures
  158. %  exists, for accessing letters beyond the 26 located in the font positions
  159. %  of the 26 roman letters.  An authoritative list of the ligature rules is
  160. %  given below, under the heading Ligatures.)  Successful use of this file
  161. %  requires appropriate cyrillic and accent fonts, arranged according to
  162. %  the AMS/MR scheme.
  163. %
  164. %  There are some weaknesses in this ligaturing and accent system.
  165. %  The following are known to be less than satisfactory:
  166. %
  167. %       the intermediate `ligatures' for shch access numerals;
  168. %       primes (transliteration of hard/soft signs) use math mode;
  169. %       underbar on `cap' double prime is too low (hard sign);
  170. %       thorn d's don't yet exist;
  171. %       \cydot uses math mode;
  172. %       this scheme is not compatible with automatic Russian hyphenation.
  173. %
  174. %
  175. %  Notes on the macros:
  176. %
  177. %       The single space following each hex character code is necessary
  178. %       to prevent the next input character from being gobbled.
  179. %
  180. %
  181. %  Note on \mark :
  182. %
  183. %       Control sequences such as these cyrillic accents should remain
  184. %       unexpanded when generating \mark's; otherwise, the definition of
  185. %       the expanded strings in effect when the \mark is used may be
  186. %       inappropriate.  By \let\...=\relax , the \... takes on the important
  187. %       characteristic of a primitive that it will not be expanded further.
  188. %       The following code has been shown to generate correct \mark entries
  189. %       that can be used successfully in running heads:
  190. %
  191. %       \newtoks\marktoks
  192. %       \def\domark{\keep@cyracc \mark{\the\marktoks}}
  193. %
  194. %       In running heads, the marks should be accessed using \the to expand
  195. %       the tokens strings properly.
  196. %
  197. %
  198. %  Ligatures
  199. %
  200. %  This is a list of all the letter ligatures in the AMS cyrillic fonts,
  201. %  and in other cyrillic fonts (such as those developed at the University
  202. %  of Washington that use the AMS arrangement).
  203. %
  204. %  LOWER CASE LIGATURES
  205. %
  206. %    A.  All-letter ligatures
  207. %
  208. %  ch = `q
  209. %  dj = '016
  210. %  kh = `h
  211. %  lj = '011
  212. %  nj = '010
  213. %  sh = `x; xc = `7 (shc); 7h = `w (shch)
  214. %  ts = `c
  215. %  ya = '037
  216. %  yu = '030
  217. %  zh = '031
  218. %
  219. %    B.  Ligatures with keyed numerals
  220. %
  221. %  c1 = '017
  222. %  d1 = '016 (dj); d2 = '012 (dzh); d3 = '036 (dz)
  223. %  e1 = '013; e2 = '015
  224. %  i1 = '014
  225. %  j1 = '037 (ya); j2 = '030 (yu)
  226. %  l1 = '011 (lj)
  227. %  n1 = '010 (nj)
  228. %  p1 = '176; p2 = '177
  229. %  z1 = '031 (zh)
  230. %
  231. %  UPPER CASE LIGATURES
  232. %    A.  All-letter ligatures
  233. %
  234. %  CH, Ch = `Q
  235. %  KH, Kh = `H
  236. %  LJ, Lj = '001
  237. %  NJ, Nj = '000
  238. %  SH, Sh = `X; XH, Xh = `6 (SHC, SHc, Shc);
  239. %            6H, 6h = `W (SHCH, SHCh, SHch, Shch)
  240. %  TS, Ts = `C
  241. %  YA, Ya = '027
  242. %  YU, Yu = '020
  243. %  ZH, Zh = '021
  244. %
  245. %    B.  Ligatures with keyed numerals
  246. %
  247. %  C1 = '007
  248. %  D1 = '006 (DJ); D2 = '002 (DZH); D3 = '026 (DZ)
  249. %  E1 = '003; E2 = '005
  250. %  I1 = '004
  251. %  J1 = '027 (YA); J2 = '020 (YU)
  252. %  L1 = '001 (LJ)
  253. %  N0 = '175 (Number sign); N1 = '000 (NJ)
  254. %  P1 = '136; P2 = '137
  255. %  Z1 = '021 (ZH)
  256. %
  257. %  DEACTIVATED LIGATURES
  258. %
  259. %  The dzh and DZH ligatures were originally built in the following manner,
  260. %  but the results were not compatible with desired keyboarding schemes.
  261. %
  262. %  dz = '036; '036(roman s)h = '012 (dzh)
  263. %  DZ = '026; '026(roman S)H = '002 (DZH)
  264. %
  265. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  266.